﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Threading.Tasks;

namespace WqLunTan.Models.DataBase
{
    /// <summary>
    /// 爬虫获取的文章内容
    /// </summary>
    [Table("article_crawler")]
    public class article_crawler : BaseUpdateEntity
    {
        /// <summary>
        /// 分类id
        /// </summary>
        public Guid cateid { get; set; }

        /// <summary>
        /// 标题
        /// </summary>
        [MaxLength(255)]
        [Required(AllowEmptyStrings = true)]
        public string title { get; set; } = string.Empty;

        /// <summary>
        /// 内容
        /// </summary>
        [Required(AllowEmptyStrings = true)]
        public string content { get; set; } = string.Empty;

        /// <summary>
        /// 内容的hash值
        /// </summary>
        [MaxLength(255)]
        [Required(AllowEmptyStrings = true)]
        public string unique_hash { get; set; } = string.Empty;

        /// <summary>
        /// 文章的tag标签, 序列化的 字符串数组
        /// </summary>
        [MaxLength(255)]
        [Required(AllowEmptyStrings = true)]
        public string tag { get; set; } = string.Empty;

        /// <summary>
        /// 数据来源链接
        /// </summary>
        [MaxLength(255)]
        [Required(AllowEmptyStrings = true)]
        public string url { get; set; } = string.Empty;

        /// <summary>
        /// 文章的封面图片
        /// </summary>
        [MaxLength(255)]
        [Required(AllowEmptyStrings = true)]
        public string img { get; set; } = string.Empty;

        /// <summary>
        /// 是否已保存到网站的文章管理系统中
        /// </summary>
        public bool is_save { get; set; }

        /// <summary>
        /// 是否已收录到网站数据库中
        /// </summary>
        public bool is_download { get; set; }

        /// <summary>
        /// 发布时间
        /// </summary>
        public DateTimeOffset publish_date { get; set; }

    }
}
